package util;

import java.util.Calendar;

/**
 * Calendar 日历类
 * 
 * 月 0-11
 * 星期  1-7 表示  日，一，二。。。六
 *
 */
public class Test2 {
	
	public static void main(String[] args) {
		
		//Calendar cal=new Calendar();		
		Calendar cal=Calendar.getInstance();
		
		cal.set(2018, 11, 29, 3, 6, 9);
		
 		
		//cal.add(Calendar.HOUR, 36);
		
		int year= cal.get(Calendar.YEAR);
		// 0-11 范围
		int month= cal.get(Calendar.MONTH);
		int date= cal.get(Calendar.DATE);
		
		int h= cal.get(Calendar.HOUR);
		int m= cal.get(Calendar.MINUTE);
		int s= cal.get(Calendar.SECOND);
		
		 
		System.out.println(year+"-"+month+"-"+date);
		System.out.println(h+":"+m+":"+s);
		System.out.println( cal.get(Calendar.DAY_OF_WEEK));
 
	}

}
